package com.weilus.config.security;

import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;

@Component
public class TokenService {

    @Cacheable(cacheNames="token",key="#token")
    public Authentication loadAuthentication(String token){
        return null;
    }

    @CachePut(cacheNames = "token",key = "#token")
    public Authentication saveAuthentication(String token,Authentication authentication){
        return authentication;
    }
}
